package com.xiaodimall.backsys.utils;

import com.xiaodimall.backsys.common.CascadeSelectionResult;
import com.xiaodimall.backsys.pojo.GoodsCategory;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: CJJ
 * @Date: Created in 2022/11/27 19:38
 * @Description:
 */
public class GoodsCategoryUtils {
    public static List<CascadeSelectionResult> goodsCategoryToCascadeSelectionResult(List<GoodsCategory> goodsCategories) {
        List<CascadeSelectionResult> cascadeSelectionResults = new ArrayList<>();
        for (GoodsCategory goodsCategory : goodsCategories) {
            cascadeSelectionResults.add(new CascadeSelectionResult(goodsCategory.getCategoryId().toString(), goodsCategory.getCategoryName()));
        }
        return cascadeSelectionResults;
    }
}
